package com.singzi.javaSenior.reference;

import java.lang.ref.SoftReference;

public class SoftReferenceTest {
    public static void main(String[] args) throws InterruptedException {
        SoftReference<byte[]> sr = new SoftReference<>(new byte[1024*1024*10]);
        System.gc();
        System.out.println(sr.get());
        Thread.sleep(1000);
        byte[] b = new byte[1024*1024*10];
        byte[] c = new byte[1024*1024*10];
        System.out.println(sr.get());
    }
}
